<?php
namespace App\Http\Forms;

use App\Library\OSS;
use App\Modules\Coupon\Models\Coupon;
use Kris\LaravelFormBuilder\Form;

class ApplicationForm extends Form
{
    public function buildForm()
    {
        $this
            ->add('name', 'text', [
                'label' => "姓名 *",
                'rules' => 'required|string|max:20',
            ])
            ->add('id_number', 'text', [
                'label' => "身份证号 *",
                'rules' => 'required|string|max:20',
            ])
            ->add('job', 'text', [
                'label' => "工作 *",
                'rules' => 'required|string|max:20',
            ])
            ->add('address', 'text', [
                'label' => "住址 *",
                'rules' => 'required|string|max:200',
            ])
            ->add('company', 'text', [
                'label' => "单位 *",
                'rules' => 'required|string|max:100',
            ])
            ->add('image', 'image', [
                'label' => "生活照 *",
                'rules' => 'required|string',
                'type' => 'apply_image',
            ])
            ->add('id_card_positive', 'image', [
                'label' => "证件正面照 *",
                'rules' => 'required|string',
                'type' => 'id_card_positive',
            ])
            ->add('id_card_back', 'image', [
                'label' => "证件反面照 *",
                'rules' => 'required|string',
                'type' => 'id_card_positive',
            ])
            ->add('submit', 'submit', [
                'attr' => ['class' => "form-control btn btn-success"],
                'label' => '保存',
            ]);
    }
}
